
/* 滚动容器样式 */
.cart-scroll {
  padding-bottom: 20rpx;
}

/* 1. 分类标题栏：flex布局，勾选框居左，删除按钮居右 */
.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20rpx 30rpx;
  background-color: #fafafa;
  border-bottom: 1px solid #f5f5f5;

  .category-selector {
    display: flex;
    align-items: center;
    gap: 12rpx; /* 勾选框与文本间距 */
  }

  .delete-category {
    font-size: 26rpx;
  }
}

/* 2. 商品项：flex布局，勾选框居左，内容居右 */
.cart-item {
  display: flex;
  align-items: center;
  padding: 20rpx 30rpx;
  border-bottom: 1px solid #f5f5f5;

  /* 左侧勾选框列：固定宽度，居中对齐 */
  .item-checkbox-col {
    width: 40rpx;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  /* 右侧内容区：占剩余宽度，flex布局 */
  .item-content {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-left: 20rpx; /* 与勾选框间距 */
  }

  .item-info {
    display: flex;
    align-items: center;
    gap: 16rpx;

    .item-img {
      width: 120rpx;
      height: 120rpx;
      border-radius: 8rpx;
      object-fit: cover;
    }

    .item-details {
      display: flex;
      flex-direction: column;
      justify-content: center;

      .item-name {
        font-size: 28rpx;
        color: #333;
        max-width: 300rpx;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }

      .item-price {
        margin-top: 10rpx;
        font-size: 28rpx;
        color: #ff4d4f;
      }
    }
  }

  /* 数量控件样式 */
  .item-quantity {
    display: flex;
    align-items: center;

    .count-btn {
      width: 50rpx;
      height: 50rpx;
      display: flex;
      align-items: center;
      justify-content: center;
      border: 1px solid #eee;
      background-color: #f9f9f9;
      box-sizing: border-box;

      &--minus {
        border-right: none;
        border-radius: 4rpx 0 0 4rpx;
      }

      &--plus {
        border-left: none;
        border-radius: 0 4rpx 4rpx 0;
      }

      &--disabled {
        color: #ccc;
        background-color: #f2f2f2;
        cursor: not-allowed;
      }
    }

    .count-btn__num {
      width: 60rpx;
      height: 50rpx;
      display: flex;
      align-items: center;
      justify-content: center;
      border-top: 1px solid #eee;
      border-bottom: 1px solid #eee;
      background-color: #fff;
      box-sizing: border-box;
    }
  }
}

/* 3. 批量删除栏：flex布局，全选居左，按钮居右 */
.batch-operation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15rpx 30rpx;
  background-color: #fff;
  border-radius: 16rpx;
  margin: 20rpx 0;

  /* 左侧全选区：flex对齐 */
  .select-all-wrap {
    display: flex;
    align-items: center;
    gap: 12rpx;
  }

  .select-all-text {
    font-size: 28rpx;
    color: #333;
  }

  /* 右侧批量删除按钮：固定样式 */
  .batch-delete-btn {
    font-size: 26rpx;
    padding: 0 20rpx;
  }
}

/* 合计栏样式 */
.cart-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20rpx 30rpx;
  background-color: #fff;
  border-radius: 16rpx;

  .summary-info {
    .total-text {
      font-size: 28rpx;
      color: #666;
    }

    .total-price {
      font-size: 32rpx;
      color: #ff4d4f;
      font-weight: 500;
      margin-left: 8rpx;
    }
  }

  .checkout-btn {
    width: 200rpx;
    height: 60rpx;
    line-height: 60rpx;
    font-size: 28rpx;
  }
}

/* 空购物车样式 */
.empty-cart {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60rpx 0;

  .empty-text {
    margin-top: 20rpx;
    color: #999;
    font-size: 28rpx;
  }
}

/* 统一勾选框居左样式（避免偏移） */
.checkbox-left {
  vertical-align: middle;
}